﻿
using Design.Common.Attri;
using Design.Common.Interface;
using Design.Common.Model;
using SimpleFatocyPattern.Factory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SimpleFatocyPattern
{
    internal enum ProductType
    {
        BYD,
        AUDI,
    }

    [DesignAttribute(nameof(SimpleFatoryDemo), DesignType.Creation, (int)CreationType.SimpleFactory)]
    public class SimpleFatoryDemo : IDesignDemo
    {
        public DesignAttribute GetDesignAttribute() => typeof(SimpleFatoryDemo).GetCustomAttribute<DesignAttribute>();

        public void RunExample(bool isRun)
        {
            if (!isRun) return;
            SimpleCarFactory.CreateProduct(ProductType.BYD);

            SimpleCarFactory.CreateProduct(ProductType.AUDI);
        }
    }
}
